package com.atguigu.boot.controller;

import com.atguigu.boot.bean.Person;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:朱思博
 * @date:2021/5/5-{10:25}
 */
@RestController
public class HelloController {

    @Autowired
    private Person person;

    // 测试Person类是否与yml配置文件绑定成功
    @RequestMapping("/person")
    public Person personYml() {
        /*
            {
                "userName":"张三",
                "boss":true,
                "birth":"2019-12-08T16:00:00.000+00:00",
                "age":18,
                "pet":{"name":"阿狗","weight":75.0},
                "interests":["篮球","足球","游戏"],
                "animal":["猫","狗"],
                "score":{"english":90,"math":70},
                "salarys":[9999.0,8888.0],
                "allPets":{
                    "sick":[{"name":"阿狗","weight":65.0},{"name":"阿猫","weight":55.0}],
                    "healthy":[{"name":"虫","weight":15.0}]}
                 }

         */
        return person;
    }
}
